import Editor from '../editor'
import { Operation } from './operation'

interface Selection {
  anchor: number
  focus: number
}
export class SetSelectionOperation extends Operation {
  selection_
  constructor(selection: Selection) {
    super()
    this.selection_ = selection
  }
  apply(editor: Editor): void {
    editor.getSelectionModel().setSelection(this.selection_)
  }
}